How to prevent nginx from appending the location to root? [duplicate]

Posted by simonszu on Server Fault See other posts from Server Fault or by simonszu
Published on 2013-10-23T14:10:44Z Indexed on 2013/10/23 15:57 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

This question already has an answer here:

I want to serve an Icinga Webview via nginx. This webview should be accessible via myserver.com/icinga (as the debian autoconfig for apache will do).

I have the following lines in my nginx config:

location /icinga {
            root   /usr/share/icinga/htdocs;
            index  index.html;
            auth_basic              "Restricted";
            auth_basic_user_file    /etc/icinga/htpasswd.users;
   }

However, i get an error 404 and a log entry that says:

*10 open() "/usr/share/icinga/htdocs/icinga" failed (2: No such file or directory),

So it seems that nginx appends the location value to the root value. I think i figured it out how to prevent this some time ago, but i did not document it for myself and have forgotten how to do it. And now i can't fix it for myself. Can you tell me how to prevent this behaviour?

© Server Fault or respective owner

Related posts about nginx

Related posts about root